package com.itheima.dao;

import com.itheima.pojo.User;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

public interface UserDao {

    @Select("select * from t_user where username=#{username}")
    @Results({
            @Result(column = "id",property = "id"),
            @Result(column = "id",property = "roles",many = @Many(select = "com.itheima.dao.RoleDao.findByUserId"))
    })
    User findByUserName(String username);
}
